package com.zhangxun.utils;

import java.util.concurrent.*;

public class ThreadPoolUtil {


    public static ThreadPoolExecutor threadPool(){

        return new ThreadPoolExecutor(
                4,
                Runtime.getRuntime().availableProcessors(),
                60,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<>(),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy()
        );
    }
}
